<?php

class Helper {
	
	public function RenderMainMenu() {
		include ("components/menus/mainmenu.php");
	}
	
	public function RenderSmallMenu($page) {
		$menu = false;
		switch ($page) {
			case "game" : 
			{
				$menu = "game";
				break;
			}
			case "led" : 
			{
				$menu = "led";
				break;
			}
			default : 
			{
				$menu = false;
				break;
			}
		}
		if ($menu) include ("components/menus/smallmenu/" . $menu . ".php");
	}
	
	public function RenderProductsMenu($id) {
		$menu = false;
		switch ($id) {
			case "a4" :
			case "a6" :
			case "a8" :
			{
				$menu = "a";
				break;
			}
			case "z3" : 
			case "z5" :
			case "z8" :
			{
				$menu = "z";
				break;
			}
			case "8c" : 
			case "8q" :
			case "theatre" :
			{
				$menu = "keyone";
				break;
			}
			case "tc" : 
			case "piccolo" :
			{
				$menu = "tc";
				break;
			}
			case "jbox" : 
			case "jboxadvanced" :
			case "jmglobal" :
			{
				$menu = "cms";
				break;
			}
			case "watch" :
			{
				$menu = "watch";
				break;
			}
			case "pharmacydisplay" :
			{
				$menu = "pharmacy";
				break;
			}
			case "singleline" :
			case "multiline" :
			case "bus" :
			{
				$menu = "informationtables";
				break;
			}
			case "traffic" :
			{
				$menu = "traffic";
				break;
			}
			default : 
			{
				$menu = false;
				break;
			}
		}
		if ($menu) include ("components/menus/productmenu/" . $menu . ".php");
	}
	
	public function RenderThumbs($key) {
		for ($i=1; $i<=3; $i++) {
			if (file_exists("media/game/images/" . $key . $i . ".jpg") && file_exists("media/game/thumbs/" . $key . $i . ".png")) {
				echo "<img src='media/game/thumbs/" . $key . $i . ".png' data-href='" . $key . $i . ".jpg' />";
			}
		}
	}
	
	public function RenderBreadcrumbs($key, $lang) {
		if (file_exists("media/game/breadcrumbs/" . $key . "-" . $lang . ".png")) {
			echo "<img src='media/game/breadcrumbs/" . $key . "-" . $lang . ".png' />";
		}
	}
	
	public function RenderLanguage($lang, $page, $id) {
		echo "
		<div id='eng' " . ($lang == "en" ? "class='active-lang'" : "") . "><a href='en/" . $page . "/" . ($id ? $id : "") . "'></a></div>
		<div id='srb' " . ($lang == "sr" ? "class='active-lang'" : "") . "><a href='sr/" . $page . "/" . ($id ? $id : "") . "'></a></div>
		";
		
	}
	
}

?>